package com.bite.plane;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/*
* 游戏窗口
* */
public class MyGameFrame extends Frame {

    //初始化窗口
    public void launchFrame() {
        this.setTitle("飞机大战");
        setVisible(true);

        setSize(800,800);
        setLocation(500,100);

        //关闭窗口
        this.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                //正常退出
                System.exit(0);
            }
        });
    }

    public static void main(String[] args) {
        MyGameFrame myGameFrame = new MyGameFrame();
        myGameFrame.launchFrame();
    }

}
